local args = ngx.req.get_uri_args()

local act_id = args.act_id

if nil == act_id then
    ngx.say([[{"code":10000,"message":"act_id不能为空"}]])
    return
end

local redis_client = require "lib.redis"
local redis = redis_client:new()

local prizes, err = redis:get("activity:"..act_id..":prizes")

if err ~= nil then
    ngx.say('{"code":10000,"message":"', err, '"}')
    return
end

if nil == prizes then
    ngx.say([[{"code":200,"message":"success","data":[]}]])
    return
end

ngx.say('{"code":200,"message":"success","data":')
ngx.say(prizes)
ngx.say('}')
